import random
import time
def fib(n):
    a, b = 0, 1
    for i in range(n):
        a, b = b, a + b
    return a

def consumer():
    
    while True:
        a = 0
        n = (yield)
        for i in xrange(0,n+1):
            if n == fib(i):
                a = 1
                print str(n) + " is a fibonacci number."
                break
        
        if a == 0:
            print str(n) + " is not a fibonacci number."
                         
def producer():
    generator = consumer()
    generator.next()
    while True:
        a = random.randrange(1,1001)      
        generator.send(a)
        time.sleep(1)
 


        
    